<#import "/admin/_layout.html" as layout>
<@layout.header "订单管理"></@layout.header>
<@layout.body>
    <div class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-left">
                        <li class="breadcrumb-item"><a href="#">订单</a></li>
                        <li class="breadcrumb-item active">列表</li>
                    </ol>
                </div>
            </div>
        </div>
    </div>
    <section class="content">
    <div class="container-fluid">
        <div class="card">

            <div class="card-header">

                <form class="form-horizontal" action="/admin/order/list">
                    <div class="row">
                        <div class="form-group row col-3">
                            <label for="title" class="col-sm-4 col-form-label">订单编号</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" id="orderSn" name="orderSn" value="${param('orderSn')!}" placeholder="订单编号">
                            </div>
                        </div>

                        <div class="form-group row col-3">
                            <label for="title" class="col-sm-3 col-form-label">商品</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" id="title" name="title" value="${param('title')!}" placeholder="标题">
                            </div>
                        </div>

                        <div class="form-group row col-3">
                            <label for="inputPassword3" class="col-sm-4 col-form-label">状态</label>
                            <div class="col-sm-8">
                                <#assign _status=param('status')!''/>
                                <select id="status" name="status" class="form-control">
                                    <option value="">全部</option>
                                    <option value="1" <@selectedIf value=(_status =='1')/>>已支付</option>
                                    <option value="0" <@selectedIf value=(_status =='0')/>>未支付</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group row col-3">
                            <div class="col-sm-12">
                                <button type="submit" class="btn btn-primary btn-sm">查询</button>
                                <button type="reset" class="btn btn-default btn-sm">重置</button>
                            </div>
                        </div>
                    </div>

                </form>

            </div>

            <div class="card-body">
                <#--<div class="row">
                    <a href="/admin/product/edit" class="btn btn-info"><i class="fas fa-plus"></i> 新增</a>
                </div>-->
                <table class="table table-hover" style="width:100%">
                    <thead>
                    <tr>
                        <th>ID</th>
                        <th width="160px">商品</th>
                        <th>下单人</th>
                        <th width="300px">收货信息</th>
                        <th>支付状态</th>
                        <th>发货状态</th>
                        <#--<th>交易状态</th>-->
                        <#--<th>支付方式</th>-->
                        <th width="100px">下单时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <#list pageData.records as item>
                        <tr>
                            <td>${item.id!}</td>
                            <td>${text(item.orderTitle!, 12)}</td>
                            <td>${item.nickName!}</td>
                            <td>
                                <p>${item.consigneeUsername!}&nbsp;&nbsp;${item.consigneeMobile!}</p>
                                <p>${item.consigneeAddrDetail!}</p>
                            </td>
                            <td>
                                <#if item.payStatus==1>已支付</#if>
                                <#if item.payStatus==0>未支付</#if>
                            </td>
                            <td>
                                <#if (item.deliveryStatus!)==1>待发货</#if>
                                <#if (item.deliveryStatus!)==2>已发货</#if>
                                <#if (item.deliveryStatus!)==4>已确认收货</#if>
                            </td>
<#--                            <td>
                                <#if item.tradeStatus==1>交易中</#if>
                                <#if item.tradeStatus==2>交易完成</#if>
                                <#if item.tradeStatus==3>已取消</#if>
                                <#if item.tradeStatus==8>交易结束</#if>
                            </td>-->
                            <#--<td>${item.payType!}</td>-->
                            <td><@formatTime value=item.created!/></td>
                            <td><a class="" href="/admin/order/detail?orderId=${item.id!}">详情</a></td>
                        </tr>
                    </#list>
                </table>
                <@layout._adminPage/>
            </div>
        </div>
    </div>
    </section>
</@layout.body>
<@layout.script>
</@layout.script>